<?php
//$Id: config.php 207 2012-03-14 09:52:26Z tomqin@gmail.com $

/**
 * Config 系统配置
 *
 * @copyright		Copyright (C) 2010-2012 ARESCMS Inc.
 * @author			TomQin <tomqin@gmail.com>
 * @license			http://www.arescms.cn/license/
 * @package Core
 */

final Class Config
{
	public static $items = array();

	/**
	 * Get a configuration item.
	 *
	 * @param string
	 * @param string
	 * @return array
	 */
	public static function get($key, $default = null)
	{
		if(empty(self::$items)) {
			self::$items = require DATA_PATH.'config.inc.php';
		}
		return isset(self::$items[$key]) ? self::$items[$key] : $default;
	}

	/**
	 * Set a configuration item.
	 *
	 * @param string
	 * @param string
	 * @return void
	 */
	public static function set($key, $var)
	{
		self::$items[$key] = $var;
	}

	/**
	 * Determine if a configuration item or file exists.
	 *
	 * @param string
	 * @return bool
	 */
	public static function has($key)
	{
		return isset(self::$item[$key]);
	}
}
?>